/**
 * Created by Student on 6/17/14.
 */
angular.module('simpleService', [])

    .factory('simple', function($http) {

        return {
            // get all the comments
//            get : function() {
//                return $http.get('comments');
//
//
            get:function(){
                return $http.get('simple');
               },

            // save a comment (pass in comment data)
            save : function(simpleData) {
//                return $http({
//                    method: 'POST',
//                    url: 'comments',
//                    headers: { 'Content-Type' : 'application/x-www-form-urlencoded' },
//                    data: $.param(commentData)
//                });
            //console.log(simpleData);
            return $http.post('simple',simpleData);
            },

            edit:function(id){
                return $http.get('simple/'+id);
            },

            //update simple

            update:function(id,obj){
                console.log(obj);
                return $http.put('simple/'+id,obj);
            },

            // destroy a comment
            destroy : function(id) {
                console.log(id);
                return $http.delete('simple/' + id);
            }
        }

    });
//registerDepartment:function(schoolId,obj){
  //  console.log(schoolId);
    //return $http.post('owners/department',obj);

//schoolList:function(){
    //return $http.get('owners/schools');